 //Definition for a binary tree node.
 struct TreeNode {
     int val;
     struct TreeNode *left;
     struct TreeNode *right;
 };
#include <stdlib.h>
struct TreeNode* sortedArrayToBST(int* nums, int numsSize) {
    if( 0 == numsSize )
        return NULL;
    struct TreeNode *n=malloc(sizeof(struct TreeNode));
    int m=numsSize/2;
    n->val=nums[m];
    n->left=sortedArrayToBST(nums,m);
    n->right=sortedArrayToBST(nums+m+1,numsSize-m-1);
    return n;
}
